package org.dromara.capital.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaIgnore;
import lombok.RequiredArgsConstructor;
import org.dromara.admin.model.UserRegisterBody;
import org.dromara.admin.service.IUserDetailService;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.domain.model.RegisterBody;
import org.dromara.capital.service.ICapitalRegisterService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 资方注册控制器
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/capital")
public class CapitalRegisterController {

    private final ICapitalRegisterService registerService;

    /**
     * 资方注册
     */
//    @SaCheckPermission("all:userDetail:add")
    @PostMapping("/register")
    public R<Void> register(@Validated @RequestBody RegisterBody user) {
        registerService.register(user);
        return R.ok();
    }

    /**
     * 新增资方账号
     */
//    @SaCheckPermission("all:userDetail:add")
    @PostMapping("/registerCapital")
    public R<Void> registerCapital(@RequestBody UserRegisterBody user) {
        registerService.registerCapital(user);
        return R.ok();
    }
}
